package com.wq.wrongquestion.serviceimpl.che;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.che.ChemistryEntity;
import com.wq.wrongquestion.mapper.che.ChemistryMapper;
import com.wq.wrongquestion.service.che.ChemistryService;

@Component
public class ChemistryServiceimpl implements ChemistryService{
    
    @Autowired
    public ChemistryMapper ChemistryMapper;
    @Override
    @Transactional
    public String getChemistryZjnm(String zjID) {
        String zjNm=ChemistryMapper.getChemistryZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getChemistryZjID() {
       List<String> allZjID=ChemistryMapper.getChemistryZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getChemistryZj() {
        List<String> zjInfo=ChemistryMapper.getChemistryZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insChemistry(ChemistryEntity ChemistryEntity) {
        ChemistryMapper.insChemistry(ChemistryEntity);
    }
    @Override
    @Transactional
    public PageInfo<ChemistryEntity> getChemistry(Integer pageNumer,Integer pageSize,ChemistryEntity ChemistryEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<ChemistryEntity> Chemistry=ChemistryMapper.getChemistry(ChemistryEntity);
        PageInfo<ChemistryEntity> pageChemistry=new PageInfo<>(Chemistry);
        return pageChemistry;
    }

    @Override
    @Transactional
    public List<ChemistryEntity> getChemistryByID(Integer id) {
        List<ChemistryEntity> Chemistry=ChemistryMapper.getChemistryByID(id);
        return Chemistry;
    }
    @Override
    @Transactional
    public Integer updChemistry(ChemistryEntity ChemistryEntity) {
        return ChemistryMapper.updChemistry(ChemistryEntity);
    }
    @Override
    @Transactional
    public Integer delChemistry(Integer id) {
        return ChemistryMapper.delChemistry(id);
    }
    
}
